package com.ebt.m.customer.model;

import com.ebt.m.customer.listener.ICustomer;

import java.io.Serializable;

public class CustomerModelMulti implements ICustomer, Serializable{

    public static final int TYPE_ITEM_0_DETAIL = 0;
    public static final int TYPE_ITEM_1_DIVIDER = 1;
    public static final int TYPE_ITEM_2_GENERAL = 2;
    public static final int TYPE_MAX_COUNT = 3;

    public CustomerModelDetail customerModelDetail;
    public String deviderText;
    public CustomerModel customerModelGeneral;
    public int type = -1;

	public CustomerModelMulti(int type, Object content){
        this.type = type;
        switch (type){
            case TYPE_ITEM_0_DETAIL:
                customerModelDetail = (CustomerModelDetail)content;
                break;
            case TYPE_ITEM_1_DIVIDER:
                deviderText = (String)content;
                break;
            case TYPE_ITEM_2_GENERAL:
                customerModelGeneral = (CustomerModel)content;
                break;
        }
	}

	@Override
	public String getCustomerUuid() {
        String cutomerUuid = null;
        switch (type){
            case TYPE_ITEM_0_DETAIL:
                cutomerUuid = customerModelDetail.getCustomerUuid();
                break;
            case TYPE_ITEM_1_DIVIDER:
                //do nothing
                break;
            case TYPE_ITEM_2_GENERAL:
                cutomerUuid = customerModelGeneral.getCustomerUuid();
                break;
        }
		return cutomerUuid;
	}
}